package com.itheima.service.impl;

import com.itheima.domain.entity.Voucher;
import com.itheima.domain.vo.Result;
import com.itheima.mapper.VoucherMapper;
import com.itheima.service.IVoucherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 坤哥
 * @since 2025-10-06
 */
@Service
public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, Voucher> implements IVoucherService {
    /**
     * 查询店铺的优惠券列表
     */
    @Override
    public Result queryVoucherOfShop(Long shopId) {
        List<Voucher> vouchers = lambdaQuery().eq(Voucher::getShopId, shopId).list();
        return Result.ok(vouchers);
    }
}
